﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using System.Xml;
using System.Resources;
using System.IO;

namespace Typheus
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            string BookmarkPath =
                Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\Typheus\\Bookmark.xml";
            string SettingsPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\Typheus\\Settings.xml";
            if (!File.Exists(BookmarkPath))
            {
                Directory.CreateDirectory(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) +
                                          "\\Typheus");
                //File.Create(BookmarkPath);
                StreamWriter sw=new StreamWriter(new FileStream(BookmarkPath,FileMode.Create,FileAccess.Write));
                sw.Write("<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<bookmarks></bookmarks>");
                sw.Close();
            }
            if (!File.Exists(SettingsPath))
            {
                //File.Create(SettingsPath);
                StreamWriter sw2 = new StreamWriter(new FileStream(SettingsPath, FileMode.Create, FileAccess.Write));
                sw2.Write("<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<settings>\n<setting id=\"HomePage\" value=\"http://www.mspaintadventures.com\"></setting>\n</settings>");
                sw2.Close();
            }
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new MainForm());
        }
    }
}
